package com.qf.mapper;

/*
 *  @author Administrator
 *  @version V1.0
 *  @Project banwoqiche
 *  @Package com.qf.mapper
 *  @Description
 *  @Date2022/3/29 0029 17:41
 */

import com.qf.bean.member.Member;
import com.qf.bean.member.MemberFav;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MemberMapper {

    List<Member> findAll();//查询所有会员

    @Select("select * from member_fav where member_id=#{memberId};")
    List<MemberFav> findAllFav(Integer memberId);//选择会员的所有收藏

    @Select("select * from member_fav left join article on article.id=member_fav.content_id where member_id=#{memberId} and fav_type=1;")
    List<MemberFav> findAllFavAirticle(Integer memberId);//选择会员的所有收藏资讯

    @Select("select * from member_fav left join activity on activity.id=member_fav.content_id where member_id=#{memberId} and fav_type=2;")
    List<MemberFav> findAllFavActivity(Integer memberId);//选择会员的所有收藏活动

    @Select("select * from car left join activity on car.id=member_fav.content_id where member_id=#{memberId} and fav_type=3;")
    List<MemberFav> findAllFavCar(Integer memberId);//选择会员的所有收藏车型

    @Select("select * from member_tag where member_id=#{memberId};")
    List<MemberFav> findAllTag(Integer memberId);//选择会员的所有标签


}
